﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using ERP_RORZE_DLL.Product.DAO;
using ERP_RORZE_DLL.Product.Base;

namespace ERP_RORZE_PRODUCT.Product.Quotation
{
    public partial class ctrlQuotationCaculation : DevExpress.XtraEditors.XtraUserControl
    {
        ClsQuationDAO clsQDAO = new ClsQuationDAO();
        DataTable dt;

        public ctrlQuotationCaculation()
        {
            InitializeComponent();
            gridView1.BestFitColumns();
        }

        void Reload(object sender, EventArgs e)
        {
            dt = clsQDAO.GetAllQuotationCal();
            gridControl1.DataSource = dt;
        }
        private void btnQview_Click(object sender, EventArgs e)
        {
            try
            {
                frm_QuotationView frmView = new frm_QuotationView();
                frmView.Text = "Quotation Caculation View By ID";
                frmView.ShowDialog();
            }
            catch
            {
            }
        }

        private void ctrlQuotationCaculation_Load(object sender, EventArgs e)
        {
            Reload(sender, e);
        }

        private void btnRefresh_Click(object sender, EventArgs e)
        {
            Reload(sender, e);
        }

        private void btnExport_Click(object sender, EventArgs e)
        {
            clsConstantsFuction.ExportToExcel(gridView1, 1, true);
        }
    }
}
